package com.commons.enums;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author mis_wu
 * @描述 自定义响应状态码枚举
 * code
 * msg
 **/
@AllArgsConstructor
@NoArgsConstructor
public enum ResponseCodeEnum {
    SUCCESS(200, "success",null),
    FAIL(300, "fail",null),
    BODY_NOT_MATCH(400, "请求的数据格式不符！",null),
    SIGNATURE_NOT_MATCH(401, "请求的数字签名不匹配！",null),
    NOT_FOUND(404, "未找到该资源！",null),
    INTERNAL_SERVER_ERROR(500, "服务器内部错误！",null),
    SERVER_BUSY(503, "服务器正忙，请稍后再试！",null),
    UNDEFINED_ERROR(1000, "未知错误！",null),
    NOTE(1001, "自定义提示！",null),
    PARAMETERERROR(409, "参数错误！",null),
    NOTLOGIN(402, "登陆错误,请联系管理员！",null),
    EXPIRE(1002, "Session过期了"),
    INVALID_TOKEN(1003,"登录失效,请退出重新登录!"),
    USERNAME_NOT_NULL(1004,"该用户不存在,请先注册!"),
    PASSWORD_ERROR(1005,"密码错误,请输入正确密码!"),
    CODE_ERROR(1006,"验证码错误,请重新验证!"),
    REGISTER_USER_EXIST(1007,"用户已存在!"),
    DOWNLOAD_SUCCESS(1008,"下载成功!"),
    UPLOAD_SUCCESS(1009,"上传成功!"),
    UPLOAD_FAIL(1010,"上传失败,请稍后再试!"),
    LOGIN_INFO_ISNULL(1011,"用户登录信息为空,请先登录!!!"),
    USER_REGISTER_ERROR(1012,"注册失败,用户名已存在!!!");

    private int code;
    private String msg;
    private Object data;

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    ResponseCodeEnum(Integer code, String msg){
        this.code=code;
        this.msg=msg;
    }

    ResponseCodeEnum(Integer code, Object data){
        this.code=code;
        this.data=data;
    }
}

